<template>
  <div/>
</template>

<script>
  import {getQueryString} from '@/utils'
  import Cookies from "js-cookie";

  export default {
    name: 'sso',
    data() {
      return {
        loginForm: {
          username: "admin",
          password: "admin123",
          rememberMe: false,
          ssoCode: "",
          code: "",
          uuid: ""
        }
      };
    },
    created() {
      Cookies.remove('Admin-Token')
      const url = window.location.href.replace('#/authredirect', '')
      this.loginForm.ssoCode = getQueryString(url, 'code')
      this.$store.dispatch("Login", this.loginForm)
        .then(() => {this.$router.push({path: this.redirect || "/"});})
    }
  }
</script>

<style>
</style>
